#ifndef GAME_H
#define GAME_H
#include <vector>
#include "hgeanim.h"
#include "hgeheader.h"

class Player;
class Map;
class MapLayer;
class Scene;

enum Direction
{
	UP=0,
	DOWN,
	LEFT,
	RIGHT,
};

namespace Game {

typedef bool ( *renderfunc )(void);
typedef bool ( *framefunc )(void);
typedef std::vector<renderfunc> RenderStack;
typedef std::vector<framefunc> FrameStack;

struct GameState
{
    GameState()
    {
        screenx = 0;
        screeny = 0;
        curmap  = NULL;
        player = NULL;
        curlayer = NULL;
		scene = NULL;
		tileunitsize = 16;
    }
    float screenx;
    float screeny;
    Map *curmap;
	Scene *scene;
    MapLayer *curlayer;
    int tileunitsize;
    Player *player;
    RenderStack renders;
    FrameStack frames;
};
extern GameState state;
void TransportPlayer( int map, int layer, int x, int y );

bool playFrame();
bool playRender();

void newGame( );
void loadGame( );
}
#endif